package ch13;

public class Trapezoid extends GeometricObject{
    private double upperBase;     // 上底
    private double driveDownm;    // 下底
    private double height;        // 高
    private double leftWaist;    //左腰
    private double rtWaist;      //右腰

    // 构造方法
    public Trapezoid(double upperBase,double driveDownm,double height, double leftWaist,double rtWaist){
        this.upperBase=upperBase;
        this.driveDownm=driveDownm;
        this.height=height;
        this.leftWaist=leftWaist;
        this.rtWaist=rtWaist;
    }

    // get和set访问器


    public double getUpperBase() {
        return upperBase;
    }

    public void setUpperBase(double upperBase) {
        this.upperBase = upperBase;
    }

    public double getDriveDownm() {
        return driveDownm;
    }

    public void setDriveDownm(double driveDownm) {
        this.driveDownm = driveDownm;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public double getLeftWaist() {
        return leftWaist;
    }

    public void setLeftWaist(double leftWaist) {
        this.leftWaist = leftWaist;
    }

    public double getRtWaist() {
        return rtWaist;
    }

    public void setRtWaist(double rtWaist) {
        this.rtWaist = rtWaist;
    }
    public double getArea() {
        return (upperBase+driveDownm) * height/2;
    }
    public double getPerimeter() {
        return upperBase+driveDownm+leftWaist+rtWaist;
    }

}
